﻿using System;

namespace Camera
{
    public enum CameraManufacturer { Hikvision, Dahua, Basler, AlliedVision, IKap, OPT, INOVANCE, Daheng }

    public enum TriggerMode { Off, On }

    public enum TriggerSource { Line0, Line1, Software, Freerun, DI0, DI1, DI2, DI3 }

    public struct Imgdata
    {
        public IntPtr data;
        public int width;
        public int height;
    }

    public delegate void ReadImageDelegate(Imgdata imgdata);
    public delegate void ConnectLossDelegate(string message);

    public abstract class CameraBase
    {
        public abstract event ReadImageDelegate ReadImageEvent;
        public abstract event ConnectLossDelegate ConnectLossEvent;

        public abstract bool Open(string deviceName);
        public abstract bool Close();
        public abstract void SetTriggerMode(TriggerMode triggerMode);
        public abstract void SetTriggerSource(TriggerSource triggerSource);
        public abstract bool TriggerSoftware();
        public abstract string GetSerialNumber();
        public abstract double GetParameter(string key);
        public abstract void SetParameter(string key, double fValue);
        public abstract bool StartGrab();
        public abstract void StopGrab();
        public abstract void UserSave();
        public abstract void LoadConfigurationFromFile(string fileName);
    }
}
